{% extends '@Default/layout.twig' %}


{% block content %}

    <h2><i class="fa fa-folder-open right-padding-5"></i> Customer List</h2>

	<div class="panel panel-white panel-animated">
	
		<div class="panel-body">
			<div class="panel-options">
		        <a class="btn btn-md btn-info" href="{{ app.urlFor('Customers-Customer-Create') }}">
		        	<i class="fa fa-plus-circle right-padding-5"></i> Add Customer
		        </a>
		    </div>
		    
		    <table class="table" id="table">
		        <thead>
		            <tr>
		                <th>Name</th>
		                <th>Nickname</th>
		                <th>Email</th>
		                <th>Phone</th>
		                <th>State</th>
		                <th>Options</th>
		            </tr>
		        </thead>
		        <tbody>
		            {% for obj in list %}
		                <tr>
		                    <td>{{ obj.getName() }}</td>
		                    <td>{{ obj.getNickname() }}</td>
		                    <td>{{ obj.getEmail() }}</td>
		                    <td>{{ obj.getPhone() }}</td>
		                    <td>{{ obj.getState() }}</td>
		                    <td>
		                        <a class="btn btn-info" href="{{ app.urlFor('Customers-Customer-Edit', {'id':obj.getId()}) }}">Edit</a>
		                        <a class="btn btn-danger" href="{{ app.urlFor('Customers-Customer-Delete', {'id':obj.getId()}) }}">Delete</a>
		                    </td>
		                </tr>
		            {% endfor %}
		        </tbody>
		    </table>
		</div>
	
	</div>
	
    

    <script type="text/javascript">
        jQuery( document ).ready( function( $ ) {
            var $table = jQuery( "#table" );
            $table.DataTable( {
                dom: 'Bfrtip',
                buttons: [
                    'copy', 'csv', 'excel', {
                        extend: 'pdfHtml5',
                        title: 'List of Customers',
                        text: 'PDF'
                    }
                ]
            } );
        } );
    </script>

{% endblock %}